//
//  CGLTool.h
//  WanHome
//
//  Created by 李劲成 on 16/9/5.
//  Copyright © 2016年 赵颜彬. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
#import <MapKit/MapKit.h>
@interface CGLTool : NSObject
typedef void(^UIAlertActionBlock)(UIAlertAction * action);
typedef void(^TextBlock)(NSString *text);
typedef void(^CompletionBlock)();

/**
 *  一个点击确定消失的提示框
 *
 *  @param target                 要显示提示框的对象
 *  @param title                  提示框标题
 *  @param message                提示框信息
 *  @param actionTitle            按钮标题
 *  @param actionBlock            按钮事件
 *  @param presentCompletionBlock 模态推出提示框完成事件
 *  @param dismissCompletionBlock 提示框消失完成事件
 */
+(void)alertControllerWithTarget:(id)target Title:(NSString *)title Message:(NSString *)message ActionTitle:(NSString *)actionTitle ActionBlock:(UIAlertActionBlock)actionBlock presentCompletionBlock:(CompletionBlock)presentCompletionBlock dismissCompletionBlock:(CompletionBlock)dismissCompletionBlock Cancel:(BOOL)cancel;
// 转换16进制颜色图
+(UIColor *) hexStringToColor: (NSString *) stringToConvert;

// urlCode 编码
+(NSString*)encodeString:(NSString*)unencodedString;
// urlCode 解码
+(NSString *)decodeString:(NSString*)encodedString;

/**
 *  解压缩
 *
 *  @param data 需要解压缩的数据
 *
 *  @return 解压缩后的数据
 */
+(NSData *)uncompressZippedData:(NSData *)data;


+(instancetype)getProperties:(Class)cls;

+ (CGSize)recaluteString:(NSString *)string attributeDictionary:(NSDictionary *)dic  OldSize:(CGSize)size;
+(UIImage *)initWithColor:(UIColor*)color rect:(CGRect)rect;
    
+ (NSString *)date:(NSDate *)date Formatter:(NSString *)formatter;
+ (NSDate *)string:(NSString *)string  Formatter:(NSString *)formatter;
+(NSString *)timestampSwitchTime:(NSInteger)timestamp andFormatter:(NSString *)format;
+ (BOOL)validateNumber:(NSString *) textString;

+ (NSData *)dataWithImage:(UIImage *)image;
//判断是否已经超出中国范围
+(BOOL)isLocationOutOfChina:(CLLocationCoordinate2D)location;
//转GCJ-02
+(CLLocationCoordinate2D)transformFromWGSToGCJ:(CLLocationCoordinate2D)wgsLoc;

//+ (BOOL)isBetweenFromHour:(NSInteger)fromHour toHour:(NSInteger)toHour;

+ (MKPolyline *)drawLineWithLocationArray:(NSArray *)locationArray View:(MKMapView *)view;
@end
